package choreganizer;

import javax.swing.*;




public class ChoreData
extends JLabel
implements Cloneable
{
	
	private static final String newLine = "\n";
	
	private String id = "";
	private String dateAdded = "";
	private String name = "";
	private String description = "";
	private String notes = "";
	

	
	public void setID(String s)
	{
		id = s;
	}
	
	public String getID()
	{
		return id;
	}
	
	public void setDateAdded(String s)
	{
		dateAdded = s;
	}
	
	public String getDateAdded()
	{
		return dateAdded;
	}
	
	public void setName(String s)
	{
		setText(s);
		name = s;
	}
	
	public String getName()
	{
		return name;
	}
	
	public void setDescription(String s)
	{
		description = s;
	}
	
	public String getDescription()
	{
		return description;
	}
	
	public void setNotes(String s)
	{
		notes = s;
	}
	
	public String getNotes()
	{
		return notes;
	}
	
	
	public String toXMLString()
	{
		StringBuilder sb = new StringBuilder();
		
		sb.append("<item id=\"" + id + "\" dateAdded=\"" + dateAdded + "\">" + newLine);
		sb.append("   <name>" + name + "</name>" + newLine);
		//sb.append("   <performedBy>" + performedBy + "</performedBy>" + newLine);
		sb.append("   <description>" + description + "</description>" + newLine);
		sb.append("   <notes>" + notes + "</notes>" + newLine);
		sb.append("</item>" + newLine);
		
		return sb.toString();
	}
	
	public String toString()
	{
		return name;
	}
	
	public Object clone( )  
	{
		try 
		{
			return super.clone( );
		} 
		catch (CloneNotSupportedException ex) 
		{
			throw new InternalError(ex.toString( ));
		}
	}
	
}